tmpdir="@KEDR_TEST_PREFIX_TEMP_SESSION@/kedr_fsim_final_template_fpoint_with_params"
payload_fsim="@kmodule_name@.ko"

test_function()
{
	# Whether fault simulation point is created
	if ! test -d "${fault_simulation_points_dir}/__kmalloc"; then
		printf "Fault simulation point '__kmalloc' is not created.\n"
		return 1
	fi

	# Whether fault simulation point has correct format string
	format_string=`cat "${fault_simulation_points_dir}/__kmalloc/format_string"`
	if test "${format_string}" != "int"; then
		printf "Fault simulation point '__kmalloc' has format string '%s', but should has '%s'.\n" "${format_string}" "int"
		return 1
	fi

	# Verify that parameters are passed correctly to the indicator.
	if ! echo "${indicator_greater_than_name}" "10" > "${fault_simulation_points_dir}/__kmalloc/current_indicator"; then
		printf "Fail to set indicator for fault simulation point '__kmalloc'.\n"
		return 1
	fi

	if ! trigger_function "__kmalloc" "10"; then
		printf "Execution of __kmalloc should succeed, but it doesn't.\n"
		return 1
	fi


	if trigger_function "__kmalloc" "11"; then
		printf "Execution of __kmalloc should fail(because of indicator), but it doesn't.\n"
		return 1
	fi
}
